

namespace Anycmd.Xacml.Runtime
{
	/// <summary>
	/// Helper class used to find the internal descriptor for the data types found in the 
	/// context or policy documents.
	/// </summary>
	public sealed class DataTypeDescriptor
	{
		#region Constructor

		/// <summary>
		/// Default constructor
		/// </summary>
		private DataTypeDescriptor()
		{
		}

		#endregion

		#region Private members

		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.FunctionDataType _function = new DataTypes.FunctionDataType();
		
		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.AnyUri _anyUri = new DataTypes.AnyUri();

		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.Base64Binary _base64Binary = new DataTypes.Base64Binary();

		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.HexBinary _hexBinary = new DataTypes.HexBinary();

		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.BooleanDataType _boolean = new DataTypes.BooleanDataType();

		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.IntegerDataType _integer = new DataTypes.IntegerDataType();

		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.DateDataType _date = new DataTypes.DateDataType();

		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.DateTime _dateTime = new DataTypes.DateTime();

		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.DaytimeDuration _dayTimeDuration = new DataTypes.DaytimeDuration();

		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.YearMonthDuration _yearMonthDuration = new DataTypes.YearMonthDuration();

		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.DoubleDataType _double = new DataTypes.DoubleDataType();

		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.Rfc822Name _rfc822Name = new DataTypes.Rfc822Name();

		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.X500Name _x500Name = new DataTypes.X500Name();

		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.StringDataType _string = new DataTypes.StringDataType();

		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.Time _time = new DataTypes.Time();

		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.Bag _bag = new DataTypes.Bag();

		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.DnsNameDataType _dnsName = new DataTypes.DnsNameDataType();

		/// <summary>
		/// The only instance of the internal data type.
		/// </summary>
		private static DataTypes.IPAddress _ipAddress = new DataTypes.IPAddress();

		#endregion

		#region Public properties

		/// <summary>
		/// The Function data type descriptor.
		/// </summary>
		static public DataTypes.FunctionDataType Function
		{
			get{ return _function; }
		}
		
		/// <summary>
		/// The AnyUri data type descriptor.
		/// </summary>
		static public DataTypes.AnyUri AnyUri
		{
			get{ return _anyUri; }
		}

		/// <summary>
		/// The Base64Binary data type descriptor.
		/// </summary>
		static public DataTypes.Base64Binary Base64Binary
		{
			get{ return _base64Binary; }
		}

		/// <summary>
		/// The HexBinary data type descriptor.
		/// </summary>
		static public DataTypes.HexBinary HexBinary
		{
			get{ return _hexBinary; }
		}

		/// <summary>
		/// The Boolean data type descriptor.
		/// </summary>
		static public DataTypes.BooleanDataType Boolean
		{
			get{ return _boolean; }
		}

		/// <summary>
		/// The Integer data type descriptor.
		/// </summary>
		static public DataTypes.IntegerDataType Integer
		{
			get{ return _integer; }
		}

		/// <summary>
		/// The Date data type descriptor.
		/// </summary>
		static public DataTypes.DateDataType Date
		{
			get{ return _date; }
		}

		/// <summary>
		/// The DateTime data type descriptor.
		/// </summary>
		static public DataTypes.DateTime DateTime
		{
			get{ return _dateTime; }
		}

		/// <summary>
		/// The DaytimeDuration data type descriptor.
		/// </summary>
		static public DataTypes.DaytimeDuration DaytimeDuration
		{
			get{ return _dayTimeDuration; }
		}

		/// <summary>
		/// The YearMonthDuration data type descriptor.
		/// </summary>
		static public DataTypes.YearMonthDuration YearMonthDuration
		{
			get{ return _yearMonthDuration; }
		}

		/// <summary>
		/// The Double data type descriptor.
		/// </summary>
		static public DataTypes.DoubleDataType Double
		{
			get{ return _double; }
		}

		/// <summary>
		/// The X500Name data type descriptor.
		/// </summary>
		static public DataTypes.X500Name X500Name
		{
			get{ return _x500Name; }
		}

		/// <summary>
		/// The Rfc822Name data type descriptor.
		/// </summary>
		static public DataTypes.Rfc822Name Rfc822Name
		{
			get{ return _rfc822Name; }
		}

		/// <summary>
		/// The String data type descriptor.
		/// </summary>
		static public DataTypes.StringDataType String
		{
			get{ return _string; }
		}

		/// <summary>
		/// The Time data type descriptor.
		/// </summary>
		static public DataTypes.Time Time
		{
			get{ return _time; }
		}

		/// <summary>
		/// The Bag data type descriptor.
		/// </summary>
		static public DataTypes.Bag Bag
		{
			get{ return _bag; }
		}

		/// <summary>
		/// The ipAddress data type descriptor.
		/// </summary>
		static public DataTypes.IPAddress IPAddress
		{
			get{ return _ipAddress; }
		}

		/// <summary>
		/// The DnsName data type descriptor.
		/// </summary>
		static public DataTypes.DnsNameDataType DnsName
		{
			get{ return _dnsName; }
		}
		#endregion
	}
}